//	Project:	HexTower
//	File:		Game.h
//	Author:		Mustafa Aldoori
//	Purpose:	Game Class to hold specific data for Game.

#pragma once

#include <Windows.h>
#include <vector>
#include "IGameState.h"
#include "Direct3D_Manager.h"
#include "DirectInput_Manager.h"
#include "DirectGraphics_Manager.h"

class CGame
{
private:
	// Screen Info
	int		m_nScreenWidth;
	int		m_nScreenHeight;
	bool	m_bWindowed;
	HWND	m_hWnd;

	// Game Time:
	DWORD m_dwGameTime;

	// Managers
	Direct3D_Manager*			m_pD3D;
	DirectInput_Manager*		m_pDI;
	DirectGraphics_Manager*		m_pGM;

	// States
	std::vector< IGameState* > m_vpStates;

	CGame( void );
	CGame( const CGame& );
	CGame& operator=( const CGame& );
	~CGame( void );

	bool	Input( void );
	void	Update();
	void	Render( void );

	void	SetWindowHandle( HWND hwnd )	{ m_hWnd = hwnd; }

public:
	static	CGame* GetInstance( void );
	void	Initialize(HWND hWnd, HINSTANCE hInstance, int nScreenWidth, int nScreenHeight, bool bWindowed );
	bool	Main( void );
	void	Shutdown( void );

	void	FullScreenMode( bool setToFullScreen );

	int		GetWidth( void ) const			{ return m_nScreenWidth;	}
	int		GetHeight( void ) const			{ return m_nScreenHeight;	}
	bool	IsWindowed( void ) const		{ return m_bWindowed;		}
	HWND	&GetWindowHandle( void )		{ return m_hWnd;			}

	// State Machine Handlers
	void PushState( IGameState* pNewState, bool bExitState = true );
	void PopState( bool bEnterState = true );
};

